};
let mut ret = deps.map(|id| self.get_package(id)).filter(|dep| {
let pkg_dep = pkg.dependencies().iter().find(|d| {
- d.name() == dep.name()
- }).unwrap();
-
- // If this target is a build command, then we only want build
- // dependencies, otherwise we want everything *other than* build
- // dependencies.
- let is_correct_dep = target.is_custom_build() == pkg_dep.is_build();
-
- // If this dependency is *not* a transitive dependency, then it
- // only applies to test/example targets
- let is_actual_dep = pkg_dep.is_transitive() ||
- target.is_test() ||
- target.is_example() ||
- profile.test;
-
- is_correct_dep && is_actual_dep
+ d.name() == dep.name() &&
+
+ // If this target is a build command, then we only want build
+ // dependencies, otherwise we want everything *other than* build
+ // dependencies.
+ target.is_custom_build() == d.is_build() &&
+
+ // If this dependency is *not* a transitive dependency, then it
+ // only applies to test/example targets
+ (d.is_transitive() ||
+ target.is_test() ||
+ target.is_example() ||
+ profile.test)
+ });
+
+ pkg_dep.is_some()
}).filter_map(|pkg| {
pkg.targets().iter().find(|t| t.is_lib()).map(|t| {
(pkg, t, self.lib_profile(pkg.package_id()))